import request from '@/utils/request';
import type { AxiosPromise } from '@/utils/request';
import type { InstallationAcceptanceVO, InstallationAcceptanceForm, InstallationAcceptanceQuery } from '@/pagesA/api/workflow/installationAcceptance/types';

/**
 * 查询设备安装阶段验收报告列表
 * @param query
 * @returns {*}
 */

export const listInstallationAcceptance = (query?: InstallationAcceptanceQuery): AxiosPromise<InstallationAcceptanceVO[]> => {
  return request({
    url: '/workflow/installationAcceptance/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询设备安装阶段验收报告详细
 * @param id
 */
export const getInstallationAcceptance = (id: string | number): AxiosPromise<InstallationAcceptanceVO> => {
  return request({
    url: '/workflow/installationAcceptance/' + id,
    method: 'get'
  });
};

/**
 * 新增设备安装阶段验收报告
 * @param data
 */
export const addInstallationAcceptance = (data: InstallationAcceptanceForm) => {
  return request({
    url: '/workflow/installationAcceptance',
    method: 'post',
    data: data
  });
};

/**
 * 修改设备安装阶段验收报告
 * @param data
 */
export const updateInstallationAcceptance = (data: InstallationAcceptanceForm) => {
  return request({
    url: '/workflow/installationAcceptance',
    method: 'put',
    data: data
  });
};

/**
 * 删除设备安装阶段验收报告
 * @param id
 */
export const delInstallationAcceptance = (id: string | number | Array<string | number>) => {
  return request({
    url: '/workflow/installationAcceptance/' + id,
    method: 'delete'
  });
};
